home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / dlbox_2 / fields.cpp < prev    next >
C/C++ Source or Header  |  1995-02-27  |  1KB  |  44 lines

  1. #include "inter.h"
  2. #include<stdio.h>
  3. #include<process.h>
  4. interface_class iface;
  5. void initg()
  6. {
  7.   int gdriver = DETECT, gmode, errorcode;
  8.   initgraph(&gdriver, &gmode, "");
  9. //  errorcode = graphresult();
  10.   settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
  11. }
  12. char deet[127];
  13.  
  14. test_box()
  15. {
  16.  
  17.   iface.clear();
  18.   iface.addbox(176,46,288,228);
  19.   iface.addtitle("Fields",109,16,BLUE,4,TRIPLEX_FONT);
  20.   iface.addtitle("Demonstration",30,53,BLUE,4,TRIPLEX_FONT);
  21.   iface.addfield("",150,100,10,3,TEXT);
  22.   iface.addfield("Default",150,120,10,4,TEXT);
  23.   iface.addfield("",150,140,10,5,TEXT);
  24.   iface.addfield("",150,160,10,6,NUMBER);
  25.   iface.addtitle("Text Field 1",73,102,DARKGRAY,4,SMALL_FONT);
  26.   iface.addtitle("Text Field 2",73,122,DARKGRAY,4,SMALL_FONT);
  27.   iface.addtitle("Text Field 3",73,142,DARKGRAY,4,SMALL_FONT);
  28.   iface.addtitle("Numeric Field 1",57,162,DARKGRAY,4,SMALL_FONT);
  29.   iface.addbutton("OK",103,190,11,97);
  30.   iface.dodialog();
  31.  
  32.   closegraph();
  33.   printf("Text field 1 %s\n",iface.get_text_field_info(3));
  34.   printf("Text field 2 %s\n",iface.get_text_field_info(4));
  35.   printf("Text field 3 %s\n",iface.get_text_field_info(5));
  36.   printf("Numeric field 1 %d\n",iface.get_number_field_info(6));
  37. }
  38.  
  39. main()
  40. {
  41.   initg();
  42.   test_box();
  43.   exit(0);
  44. }